package com.jg.controller;

import com.jg.comm.responce.R;
import com.jg.model.vo.OrderDetailVo;
import com.jg.service.PurchaseOrderDetailsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 采购明细表 记录每个采购订单的具体商品信息。 前端控制器
 * </p>
 *
 * @author 86130
 * @since 2025-09-19 11:21
 */
@RestController
@RequestMapping("/purchaseOrderDetails")
@Tag(name = "采购订单明细信息前端控制器", description = "采购订单明细管理")
public class PurchaseOrderDetailsController {
    @Autowired
    private PurchaseOrderDetailsService purchaseOrderDetailsService;
    //通过订单Id和供应商Id查询订单的详情
    @GetMapping("/selectOrderDetails/{orderId}/{supplierId}")
    @Operation(description = "通过订单Id和供应商Id查询订单的详情")
    @Parameter(name = "orderId",description = "订单Id")
    @Parameter(name = "supplierId",description = "供应商Id")
    public R<List<OrderDetailVo>> selectOrderDetails(@PathVariable String orderId, @PathVariable Integer supplierId){
        List<OrderDetailVo> orderDetailVos = purchaseOrderDetailsService.selectOrderDetails(orderId,supplierId);
        return R.success(orderDetailVos);
    }

}